#!/bin/bash
#
    for src_file in $(find /opt/rh -type f); do
        # 将bj替换为sh，获取同名的文件 
        dest_file=${src_file/rh/xx/}
        
        if [ ! -e $dest_file ]; then
           echo "文件$dest_file丢失"
        else
           src_file_md5=$(md5sum $src_file | awk '{print $1}')
           dest_file_md5=$(md5sum $dest_file | awk '{print $1}')
           if [ $dest_file_md5 != $src_file_md5 ]; then
              echo "文件${dest_file}数据不一致"
           fi
        fi
done
